import { debounce } from '@/utils'

export default {
  props: {
    filters: Array,
    btns: Array
  },
  methods: {
    paramsGen() {
      const res = {}
      for (const filter of this.filters) {
        res[filter.key] = filter.value
      }
      return res
    },
    onChange: debounce(function() {
      this.$emit('onChange', this.paramsGen())
    }, 1000)
  }
}
